package com.taijihuabao.modules.service;

import com.taijihuabao.modules.entity.ExpenseEntity;
import org.activiti.engine.task.Task;

import java.util.List;

/**
 * @author luoxianan
 */
public interface ExpenseFlowService {
    /**
     * 流程的部署
     */
    void saveNewDeploye();

    /**
     * 发起申请
     */
    void initApply(ExpenseEntity expenseEntity);

    /**
     *本部门审批
     * @param expenseEntity
     */
    void deptExpense(ExpenseEntity expenseEntity);

    /**
     * 父级部门审批
     * @param userId
     * @param expenseEntity
     */
    void parentExpense(Long userId,ExpenseEntity expenseEntity);

    /**
     * 财务部门审批
     * @param userId
     * @param expenseEntity
     */
    void allDeptExpense(Long userId,ExpenseEntity expenseEntity);


    /**
     * 修改审批单
     * @param bizKey
     * @return
     */
    Task updateExpense(String bizKey);

    /**
     *  根据报销单号查询审批单
     * @param expenseEntity
     * @return
     */
    ExpenseEntity selectByExpenseId(ExpenseEntity expenseEntity);

    /**
     * 根据审批编码查询审批单
     * @param expenseEntity
     * @return
     */
    List<ExpenseEntity> selectByExpenseCode(ExpenseEntity expenseEntity);

    /**
     * 查询待办审批单
     * @param userId
     * @return
     */
    List<ExpenseEntity> selectByExpense(Long userId);

    /**
     * 根据申请人id查询审批单
     * @param expenseEntity
     * @return
     */
    List<ExpenseEntity> selectByApplyUserId(ExpenseEntity expenseEntity);

    /**
     * 查询审批历史流程
     * @param expenseEntity
     * @return
     */
//    List<ActivitiVO> historyActInstanceList(ExpenseEntity expenseEntity);

    /**
     * 完成审批
     * @param userId
     * @param expenseEntity
     * @return
     */
    void expenseTask(Long userId,ExpenseEntity expenseEntity);

    /**
     * 查询已办
     * @param
     * @return
     */
    List<ExpenseEntity> completeTask(Long userId);
}
